<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Document</title>
  <style>
    #wenben{
      border: 1px solid skyblue;
    }
  </style>
</head>
<body>
  <canvas id="wenben" width="300" height="300"></canvas>
</body>
<script>
  // var huabu = document.getElementById("wenben");
  // var bi = huabu.getContext("2d");
  // console.log(huabu.width);
  // bi.moveTo(0,0);
  // bi.lineTo(50,50);
  // bi.lineWidth="30";
  // bi.strokeStyle = "#ccc";
  // bi.stroke();
  function getUrlParam(name) {
   var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
   var r = window.location.search.substr(1).match(reg);
   if (r != null) return unescape(r[2]); return null;
  }

  var a = getUrlParam('name')
  console.log(a);
</script>
</html>